From c33052be1b95cf19656cf1ec8e108b40f5cb4f01 Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:53:35 -0600 Subject: [PATCH] Retire qmake. (#935) * remove qmake. * fix fedora cmake builds in CI. * update build instructions in doc. * more qmake cleanup * remove rc stringification nonsense * tweak build instructions. --- .github/workflows/fedora.yml | 4 +- .github/workflows/macos.yml | 10 +- .github/workflows/ubuntu.yml | 2 - .github/workflows/windows.yml | 46 +-- .github/workflows/windows_ondemand.yml | 126 ------- GPSBabel.pro | 452 ------------------------- INSTALL | 81 +++-- gbversion.h.in | 2 +- gbversion.h.qmake.in | 19 -- gbversion.pri | 38 --- gui/CMakeLists.txt | 5 +- gui/app.pro | 170 ---------- gui/app.rc | 6 +- gui/coretool/core.pro | 8 - gui/coretool/coretool.pro | 51 --- gui/package_app | 13 +- gui/setup.iss.qmake.in | 90 ----- libusb.pri | 66 ---- mac/libusb/libusb.pro | 33 -- shapelib.pri | 26 -- tools/Dockerfile_f32 | 2 +- tools/Dockerfile_f35 | 2 +- tools/build_and_test.sh | 41 --- tools/make_windows_release.ps1 | 103 ------ tools/nuke_format | 2 - tools/reset_nuke | 7 +- tools/travis_script_osx | 44 --- win32/gpsbabel.rc | 6 +- xmldoc/chapters/build.xml | 262 +++++++------- zlib.pri | 49 --- 30 files changed, 245 insertions(+), 1521 deletions(-) delete mode 100644 .github/workflows/windows_ondemand.yml delete mode 100644 GPSBabel.pro delete mode 100644 gbversion.h.qmake.in delete mode 100644 gbversion.pri delete mode 100755 gui/app.pro delete mode 100644 gui/coretool/core.pro delete mode 100644 gui/coretool/coretool.pro delete mode 100644 gui/setup.iss.qmake.in delete mode 100644 libusb.pri delete mode 100644 mac/libusb/libusb.pro delete mode 100644 shapelib.pri delete mode 100755 tools/build_and_test.sh delete mode 100755 tools/make_windows_release.ps1 delete mode 100755 tools/travis_script_osx delete mode 100644 zlib.pri diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index ce46fbc5d..79c38dd14 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -26,4 +26,6 @@ jobs: - name: build_and_test run: | - ./tools/build_and_test.sh + # when using containers manually whitelist the checkout directory to allow git commands to work + git config --global --add safe.directory "${GITHUB_WORKSPACE}" + ./tools/build_and_test_cmake.sh diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 63087994f..b12fbdc27 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -22,10 +22,6 @@ jobs: XCODE_VERSION: '12.4' GENERATOR: 'Ninja' RELEASE: false - - QT_VERSION: '6.2.4' - XCODE_VERSION: '12.5.1' - GENERATOR: 'qmake' - RELEASE: false - QT_VERSION: '6.2.4' XCODE_VERSION: '12.5.1' GENERATOR: 'Xcode' @@ -69,11 +65,7 @@ jobs: run: | source ${HOME}/Cache/qt-${{ matrix.QT_VERSION }}.env sudo xcode-select --switch /Applications/Xcode_${{ matrix.XCODE_VERSION }}.app - if [ "${{ matrix.GENERATOR }}" == qmake ]; then - ./tools/travis_script_osx - else - ./tools/ci_script_osx.sh . ${{ matrix.QT_VERSION }} ${{ matrix.GENERATOR }} - fi + ./tools/ci_script_osx.sh . ${{ matrix.QT_VERSION }} ${{ matrix.GENERATOR }} - name: Deploy # This only handles continous releases now, for other events artifacts may be saved in diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 47b633780..ab17eefeb 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -18,8 +18,6 @@ jobs: fail-fast: false matrix: include: - - IMAGE: 'focal' - SCRIPT: './tools/build_and_test.sh' - IMAGE: 'focal' SCRIPT: './tools/build_and_test_cmake.sh' - IMAGE: 'jammy' diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8675c3b8a..3eb338be2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,54 +14,60 @@ jobs: windows: name: windows Build - runs-on: windows-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - QT_VERSION: '5.12.12' ARCH: 'amd64' - HOST_ARCH: 'x86' - COMPILER: 'msvc2017_64' - METHOD: 'aqt' - FLOW: 'nmake' - RELEASE: false - - QT_VERSION: '5.12.12' - ARCH: 'amd64' - HOST_ARCH: 'x86' + HOST_ARCH: 'amd64' COMPILER: 'msvc2017_64' METHOD: 'aqt' - FLOW: 'msbuild' + GENERATOR: 'Visual Studio 16 2019' RELEASE: false + os: windows-2019 - QT_VERSION: '5.12.12' ARCH: 'amd64' - HOST_ARCH: 'x86' + HOST_ARCH: 'amd64' COMPILER: 'msvc2017_64' - VCVERSION: '14.16' + TOOLSET: 'v141,version=14.16.27023' METHOD: 'aqt' - FLOW: 'nmake' + GENERATOR: 'Visual Studio 16 2019' RELEASE: false + os: windows-2019 - QT_VERSION: '5.12.12' ARCH: 'x86' - HOST_ARCH: 'x86' + HOST_ARCH: 'amd64' COMPILER: 'msvc2017' METHOD: 'aqt' + GENERATOR: 'Visual Studio 16 2019' RELEASE: false - FLOW: 'nmake' + os: windows-2019 - QT_VERSION: '6.2.4' ARCH: 'amd64' HOST_ARCH: 'amd64' COMPILER: 'msvc2019_64' METHOD: 'aqt' - RELEASE: true - FLOW: 'nmake' + GENERATOR: 'Visual Studio 16 2019' + RELEASE: false + os: windows-2019 - QT_VERSION: '6.2.4' ARCH: 'amd64' HOST_ARCH: 'amd64' COMPILER: 'msvc2019_64' METHOD: 'aqt' + GENERATOR: 'Visual Studio 17 2022' RELEASE: false + os: windows-latest + - QT_VERSION: '6.2.4' + ARCH: 'amd64' + HOST_ARCH: 'amd64' + COMPILER: 'msvc2019_64' + METHOD: 'aqt' + RELEASE: true GENERATOR: 'Ninja' + os: windows-latest steps: - name: Checkout repository @@ -92,11 +98,7 @@ jobs: shell: powershell run: | .\tools\ci_setup_windows.ps1 -qtdir "$Home\Cache\Qt\${{ matrix.QT_VERSION }}\${{ matrix.COMPILER }}" -arch "${{ matrix.ARCH }}" -host_arch "${{ matrix.HOST_ARCH }}" -vcversion "${{ matrix.VCVERSION }}" - if ( "${{ matrix.generator }}" ) { - .\tools\ci_script_windows.ps1 -generator "${{ matrix.GENERATOR }}" -arch "${{ matrix.ARCH }}" -toolset "${{ matrix.TOOLSET }}" - } else { - .\tools\make_windows_release.ps1 -iscc "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" -buildinstaller true -flow "${{ matrix.FLOW }}" -arch "${{ matrix.ARCH }}" - } + .\tools\ci_script_windows.ps1 -generator "${{ matrix.GENERATOR }}" -arch "${{ matrix.ARCH }}" -toolset "${{ matrix.TOOLSET }}" - name: Rename shell: bash diff --git a/.github/workflows/windows_ondemand.yml b/.github/workflows/windows_ondemand.yml deleted file mode 100644 index 015b0eec7..000000000 --- a/.github/workflows/windows_ondemand.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: "windows ondemand" - -on: - schedule: - - cron: '27 4 * * 2' - workflow_dispatch: ~ - -jobs: - - windows: - name: windows ondemand Build - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - QT_VERSION: '5.12.12' - ARCH: 'amd64' - HOST_ARCH: 'amd64' - COMPILER: 'msvc2017_64' - METHOD: 'aqt' - GENERATOR: 'Visual Studio 16 2019' - RELEASE: false - os: windows-2019 - - QT_VERSION: '5.12.12' - ARCH: 'amd64' - HOST_ARCH: 'amd64' - COMPILER: 'msvc2017_64' - TOOLSET: 'v141,version=14.16.27023' - METHOD: 'aqt' - GENERATOR: 'Visual Studio 16 2019' - RELEASE: false - os: windows-2019 - - QT_VERSION: '5.12.12' - ARCH: 'x86' - HOST_ARCH: 'amd64' - COMPILER: 'msvc2017' - METHOD: 'aqt' - GENERATOR: 'Visual Studio 16 2019' - RELEASE: false - os: windows-2019 - - QT_VERSION: '6.2.4' - ARCH: 'amd64' - HOST_ARCH: 'amd64' - COMPILER: 'msvc2019_64' - METHOD: 'aqt' - GENERATOR: 'Visual Studio 16 2019' - RELEASE: false - os: windows-2019 - - QT_VERSION: '6.2.4' - ARCH: 'amd64' - HOST_ARCH: 'amd64' - COMPILER: 'msvc2019_64' - METHOD: 'aqt' - GENERATOR: 'Visual Studio 17 2022' - RELEASE: false - os: windows-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Cache Qt - uses: actions/cache@v3 - id: cache - with: - path: ~/Cache - key: ${{ runner.os }}-${{ matrix.QT_VERSION }}-${{ matrix.COMPILER }}-${{ secrets.CACHE_VERSION }} - - - name: Install Qt setup(aqt) - if: steps.cache.outputs.cache-hit != 'true' - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - - name: Install Qt - if: steps.cache.outputs.cache-hit != 'true' - env: - CI_BUILD_DIR: ${{ github.workspace }} - shell: bash - run: | - ./tools/ci_install_windows.sh "${{ matrix.QT_VERSION }}" "${{ matrix.COMPILER }}" "${{ matrix.METHOD }}" - - - name: Build - shell: powershell - run: | - .\tools\ci_setup_windows.ps1 -qtdir "$Home\Cache\Qt\${{ matrix.QT_VERSION }}\${{ matrix.COMPILER }}" -arch "${{ matrix.ARCH }}" -host_arch "${{ matrix.HOST_ARCH }}" -vcversion "${{ matrix.VCVERSION }}" - if ( "${{ matrix.generator }}" ) { - .\tools\ci_script_windows.ps1 -generator "${{ matrix.GENERATOR }}" -arch "${{ matrix.ARCH }}" -toolset "${{ matrix.TOOLSET }}" - } else { - .\tools\make_windows_release.ps1 -iscc "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" -buildinstaller true -flow "${{ matrix.FLOW }}" -arch "${{ matrix.ARCH }}" - } - - - name: Rename - shell: bash - run: | - VERSION_ID=$(date -u +%Y%m%dT%H%MZ --date=$(git show -s --format=%aI HEAD))-$(git rev-parse --short=7 HEAD) - mv bld/gui/GPSBabel-*-Setup.exe bld/gui/GPSBabel-${VERSION_ID}-Setup.exe - mv bld/gui/GPSBabel-*-Manifest.txt bld/gui/GPSBabel-${VERSION_ID}-Manifest.txt - - - name: Test - shell: bash - run: | - # PATH="${HOME}/Cache/Qt/${{ matrix.QT_VERSION }}/${{ matrix.COMPILER }}/bin:${PATH}" - PNAME=./bld/gui/package/gpsbabel.exe GBTEMP=./gbtemp ./testo 2>&1 - PNAME=./bld/gui/package/gpsbabel.exe GBTEMP=./gbtemp ./test_encoding_utf8 2>&1 - - - name: Deploy - # This only handles continous releases now, for other events artifacts may be saved in - # the 'Upload Artifacts' step. - if: ( github.event_name == 'push' ) && ( github.ref == 'refs/heads/master' ) && matrix.RELEASE - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RELEASE_NAME: Continuous-${{ runner.os }} - run: | - ./tools/uploadtool/upload_github.sh bld/gui/GPSBabel-*-Setup.exe - - - name: 'Upload Artifacts' - uses: actions/upload-artifact@v3 - with: - name: Windows_Installer ${{ join(matrix.*) }} - path: | - ./bld/gui/GPSBabel-*-Setup.exe - ./bld/gui/GPSBabel-*-Manifest.txt - retention-days: 7 diff --git a/GPSBabel.pro b/GPSBabel.pro deleted file mode 100644 index 72a41aaf3..000000000 --- a/GPSBabel.pro +++ /dev/null @@ -1,452 +0,0 @@ -# Enforce minimum Qt version. -# versionAtLeast() was introduced in Qt 5.10, so we cannot count on it being available. -MIN_QT_VERSION = 5.12 # major[.minor[.patch]] -MIN_QT_VERSION_COMPONENTS = $$split(MIN_QT_VERSION, .) -MIN_QT_VERSION_MAJOR = $$member(MIN_QT_VERSION_COMPONENTS, 0) -MIN_QT_VERSION_MINOR = $$member(MIN_QT_VERSION_COMPONENTS, 1) -MIN_QT_VERSION_PATCH = $$member(MIN_QT_VERSION_COMPONENTS, 2) -count(MIN_QT_VERSION_MINOR, 0): MIN_QT_VERSION_MINOR = 0 -count(MIN_QT_VERSION_PATCH, 0): MIN_QT_VERSION_PATCH = 0 -lessThan(QT_MAJOR_VERSION, $$MIN_QT_VERSION_MAJOR) | \ -if(equals(QT_MAJOR_VERSION, $$MIN_QT_VERSION_MAJOR):lessThan(QT_MINOR_VERSION, $$MIN_QT_VERSION_MINOR)) | \ -if(equals(QT_MAJOR_VERSION, $$MIN_QT_VERSION_MAJOR):equals(QT_MINOR_VERSION, $$MIN_QT_VERSION_MINOR):lessThan(QT_PATCH_VERSION, $$MIN_QT_VERSION_PATCH)) { - error("$$QMAKE_QMAKE uses Qt version $$QT_VERSION but version $${MIN_QT_VERSION_MAJOR}.$${MIN_QT_VERSION_MINOR}.$${MIN_QT_VERSION_PATCH} or newer is required.") -} - -QT -= gui -versionAtLeast(QT_VERSION, 6.0): QT += core5compat - -# set VERSION related variables and generate gbversion.h -include(gbversion.pri) - -TARGET = gpsbabel -VERSION = $$GB.VERSION - -CONFIG += console -CONFIG -= app_bundle -CONFIG += c++17 -CONFIG += link_pkgconfig -!disable_pch { - # avoid QTBUG-72404, QTBUG-79694 which were fixed in 5.14.0 - versionAtLeast(QT_VERSION, 5.14.0) | !contains(QMAKE_CXX, .*clang.*) { - CONFIG += precompile_header - PRECOMPILED_HEADER = precompiled_headers.h - } else { - message("Not using precompiled headers due to QTBUG.") - } -} - -TEMPLATE = app - -# RESOURCES -RESOURCES = gpsbabel.qrc - -# MINIMAL_FMTS -MINIMAL_FMTS = \ - explorist_ini.cc \ - garmin.cc \ - garmin_device_xml.cc \ - garmin_tables.cc \ - geo.cc \ - gpx.cc \ - kml.cc \ - magproto.cc \ - nmea.cc \ - wbt-200.cc - -# ALL_FMTS -ALL_FMTS = $$MINIMAL_FMTS \ - brauniger_iq.cc \ - dg-100.cc \ - exif.cc \ - garmin_fit.cc \ - garmin_gpi.cc \ - garmin_txt.cc \ - garmin_xt.cc \ - gdb.cc \ - geojson.cc \ - globalsat_sport.cc \ - gpssim.cc \ - gtm.cc \ - gtrnctr.cc \ - holux.cc \ - html.cc \ - humminbird.cc \ - igc.cc \ - lowranceusr.cc \ - mtk_logger.cc \ - navilink.cc \ - osm.cc \ - ozi.cc \ - qstarz_bl_1000.cc \ - random.cc \ - sbn.cc \ - sbp.cc \ - shape.cc \ - skytraq.cc \ - subrip.cc \ - text.cc \ - tpg.cc \ - tpo.cc \ - unicsv.cc \ - v900.cc \ - vcf.cc \ - xcsv.cc \ - -# ALL_FMTS = $$MINIMAL_FMTS - -# FILTERS -FILTERS = \ - arcdist.cc \ - bend.cc \ - discard.cc \ - duplicate.cc \ - height.cc \ - interpolate.cc \ - nukedata.cc \ - polygon.cc \ - position.cc \ - radius.cc \ - resample.cc \ - reverse_route.cc \ - smplrout.cc \ - sort.cc \ - stackfilter.cc \ - swapdata.cc \ - trackfilter.cc \ - transform.cc \ - validate.cc -FILTER_HEADERS = $$FILTERS -FILTER_HEADERS ~= s/\\.cc/.h/g - -# JEEPS -JEEPS += \ - jeeps/gpsapp.cc \ - jeeps/gpscom.cc \ - jeeps/gpsdevice.cc \ - jeeps/gpsdevice_ser.cc \ - jeeps/gpsdevice_usb.cc \ - jeeps/gpsmath.cc \ - jeeps/gpsmem.cc \ - jeeps/gpsprot.cc \ - jeeps/gpsread.cc \ - jeeps/gpsrqst.cc \ - jeeps/gpssend.cc \ - jeeps/gpsserial.cc \ - jeeps/gpsusbcommon.cc \ - jeeps/gpsusbread.cc \ - jeeps/gpsusbsend.cc \ - jeeps/jgpsutil.cc - - -# SUPPORT -SUPPORT = \ - cet_util.cc \ - csv_util.cc \ - fatal.cc \ - filter_vecs.cc \ - formspec.cc \ - garmin_fs.cc \ - gbfile.cc \ - gbser.cc \ - globals.cc \ - grtcirc.cc \ - inifile.cc \ - main.cc \ - mkshort.cc \ - parse.cc \ - rgbcolors.cc \ - route.cc \ - session.cc \ - src/core/logging.cc \ - src/core/nvector.cc \ - src/core/textstream.cc \ - src/core/usasciicodec.cc \ - src/core/vector3d.cc \ - src/core/xmlstreamwriter.cc \ - strptime.c \ - units.cc \ - util.cc \ - util_crc.cc \ - vecs.cc \ - waypt.cc \ - xmlgeneric.cc \ - xmltag.cc - -versionAtLeast(QT_VERSION, 6.0): SUPPORT += src/core/codecdevice.cc - -# HEADERS -HEADERS = \ - cet_util.h \ - csv_util.h \ - defs.h \ - dg-100.h \ - exif.h \ - explorist_ini.h \ - filter.h \ - filter_vecs.h \ - format.h \ - formspec.h \ - garmin_device_xml.h \ - garmin_fit.h \ - garmin_fs.h \ - garmin_gpi.h \ - garmin_icon_tables.h \ - garmin_tables.h \ - gbfile.h \ - gbser.h \ - gbser_private.h \ - gdb.h \ - geojson.h \ - globalsat_sport.h \ - gpx.h \ - grtcirc.h \ - gtrnctr.h \ - heightgrid.h \ - holux.h \ - humminbird.h \ - html.h \ - inifile.h \ - kml.h \ - legacyformat.h \ - lowranceusr.h \ - magellan.h \ - navilink.h \ - nmea.h \ - osm.h \ - qstarz_bl_1000.h \ - random.h \ - session.h \ - shape.h \ - skytraq.h \ - strptime.h \ - subrip.h \ - text.h \ - unicsv.h \ - units.h \ - vecs.h \ - xcsv.h \ - xmlgeneric.h \ - jeeps/garminusb.h \ - jeeps/gps.h \ - jeeps/gpsapp.h \ - jeeps/gpscom.h \ - jeeps/gpsdatum.h \ - jeeps/gpsdevice.h \ - jeeps/gpsfmt.h \ - jeeps/gpsmath.h \ - jeeps/gpsmem.h \ - jeeps/gpsport.h \ - jeeps/gpsprot.h \ - jeeps/gpsread.h \ - jeeps/gpsrqst.h \ - jeeps/gpssend.h \ - jeeps/gpsserial.h \ - jeeps/gpsusbcommon.h \ - jeeps/gpsusbint.h \ - jeeps/gpsutil.h \ - src/core/datetime.h \ - src/core/file.h \ - src/core/logging.h \ - src/core/nvector.h \ - src/core/textstream.h \ - src/core/usasciicodec.h \ - src/core/vector3d.h \ - src/core/xmlstreamwriter.h \ - src/core/xmltag.h - -versionAtLeast(QT_VERSION, 6.0): HEADERS += src/core/codecdevice.h - -HEADERS += $$FILTER_HEADERS - -CONFIG(release, debug|release): DEFINES *= NDEBUG - -unix { - if (equals(MAKEFILE_GENERATOR, XCODE)) { - # "Configure tests are not supported with the XCODE Makefile generator" - # assume we have the following headers - # these are used by zlib - DEFINES += HAVE_UNISTD_H - DEFINES += HAVE_STDARG_H - } else { - load(configure) - qtCompileTest(unistd) { - # this is used by zlib - DEFINES += HAVE_UNISTD_H - } - qtCompileTest(stdarg) { - # this is used by zlib - DEFINES += HAVE_STDARG_H - } - } - SOURCES += gbser_posix.cc - HEADERS += gbser_posix.h -} - -win32 { - DEFINES += __WIN32__ - DEFINES -= UNICODE _UNICODE - CONFIG(debug, debug|release) { - DEFINES += _DEBUG - } - SOURCES += gbser_win.cc - HEADERS += gbser_win.h - JEEPS += jeeps/gpsusbwin.cc - LIBS += "-lsetupapi" - RC_FILE = win32/gpsbabel.rc -} - -win32-msvc* { - DEFINES += _CRT_SECURE_NO_WARNINGS - DEFINES += _CRT_NONSTDC_NO_WARNINGS - QMAKE_CFLAGS += /MP -wd4267 - QMAKE_CXXFLAGS += /MP -wd4267 - # The -wd (disable warning) and -w3 (change warning to level 3) options are exclusive. - # The win32-msvc makespec uses -w34100, which can interfer with -wd4100. - # Their are two qmake settings for warnings in CONFIG: warn_on and warn_off. - # This results in the warning showing with msbuild, but not with nmake, even if - # -wd4100 is included in QMAKE_CFLAGS and QMAKE_CXXFLAGS. - # Override win32-msvc, leaving these warnings at their default of level 4, which - # will not show up because we run at level 3. - # shapelib/shpopen.c can cause a C4100 error. - QMAKE_CFLAGS_WARN_ON -= -w34100 - QMAKE_CXXFLAGS_WARN_ON -= -w34100 -} - -include(shapelib.pri) -include(zlib.pri) -include(libusb.pri) - -SOURCES += $$ALL_FMTS $$FILTERS $$SUPPORT $$JEEPS - -SOURCES = $$sorted(SOURCES) -HEADERS = $$sorted(HEADERS) - -# We don't care about stripping things out of the build. Full monty, baby. -DEFINES += MAXIMAL_ENABLED -DEFINES += FILTERS_ENABLED -DEFINES += CSVFMTS_ENABLED - -# Creator insists on adding -W to -Wall which results in a completely -# absurd amount of jibber-jabber on perfectly legally formed code. -# Rather than wade through a thousand lines of yammer, let's just nuke -W -# but leave -Wall, which actually has useful stuff. -# Citation: http://stackoverflow.com/questions/18667291/disable-wall-compiler-warnings-in-a-qt-project -QMAKE_CFLAGS_WARN_ON -= -W -QMAKE_CXXFLAGS_WARN_ON -= -W - -check.depends = $(TARGET) FORCE -check.commands = @PNAME=./$(TARGET) $${PWD}/testo -QMAKE_EXTRA_TARGETS += check - -check-vtesto.depends = $(TARGET) FORCE -check-vtesto.commands += @$(MAKE) -s -f $${PWD}/Makefile_vtesto srcdir=$${PWD} builddir=$${OUT_PWD} check-vtesto -QMAKE_EXTRA_TARGETS += check-vtesto -QMAKE_CLEAN += $${OUT_PWD}/testo.d/*.vglog - -# build the compilation data base used by clang tools including clang-tidy. -unix { - compile_command_database.target = compile_commands.json - compile_command_database.commands = $(MAKE) clean; bear $(MAKE) - QMAKE_EXTRA_TARGETS += compile_command_database -} - -# run clang-tidy -# example usage: -# make clang-tidy RUN_CLANG_TIDY_FLAGS="-header-filter=.*\\\.h -checks=-*,modernize-use-nullptr -fix" -# It seems to be better to use run-clang-tidy with the compilation database as opposed to -# running clang-tidy directly and listing the -# compilation options on the clang-tidy line after --. -# An example is modernize-use-override which inserts repeadted overrides when run directly, -# but works as expected when run with run-clang-tidy. -clang-tidy.commands = run-clang-tidy.py $(RUN_CLANG_TIDY_FLAGS) -clang-tidy.depends = compile_commands.json -QMAKE_EXTRA_TARGETS += clang-tidy - -# generate coverage report for codacy -# must use gcc, g++ -# dependencies: -# extra ubuntu bionic packages: gcovr lcov -linux{ - coverage.commands = $(MAKE) clean; - coverage.commands += rm -f gpsbabel_coverage.xml; - coverage.commands += $(MAKE) CFLAGS=\"$(CFLAGS) -fprofile-arcs -ftest-coverage\" CXXFLAGS=\"$(CXXFLAGS) -fprofile-arcs -ftest-coverage\" LFLAGS=\"$(LFLAGS) --coverage\" && - coverage.commands += ./testo && - coverage.commands += gcov -r -o . $(SOURCES) && - coverage.commands += gcovr -k -r . --xml --exclude='zlib/*' --exclude='shapelib/*' -o gpsbabel_coverage.xml; - coverage.commands += lcov --capture --directory . --no-external --output-file coverage.info; - coverage.commands += genhtml coverage.info --output-directory coverage_report; - QMAKE_EXTRA_TARGETS += coverage -} - -cppcheck.commands = cppcheck --enable=all --force --config-exclude=zlib --config-exclude=shapelib $(INCPATH) $$ALL_FMTS $$FILTERS $$SUPPORT $$JEEPS -QMAKE_EXTRA_TARGETS += cppcheck - -gpsbabel.org.depends = gpsbabel gpsbabel.pdf FORCE -equals(PWD, $${OUT_PWD}) { - # may be overridden on qmake command line - !defined(WEB, var) { - WEB = ../babelweb - } - gpsbabel.org.commands += tools/make_gpsbabel_org.sh $$shell_quote($$WEB) $$shell_quote($$DOCVERSION); -} else { - gpsbabel.org.commands += echo "target gpsbabel.org is not supported for out of source builds."; - gpsbabel.org.commands += exit 1; -} -QMAKE_EXTRA_TARGETS += gpsbabel.org - -# -# The gpsbabel.pdf target depends on additional tools. -# On macOS you can 'brew install fop' to get fop and the hyphenation package. -# On Debian/Ubuntu you can 'apt-get install fop' to get fop and the hyphenation package. -# 'fop' must be obtained from your distribution or http://xmlgraphics.apache.org/fop/ -# 0.92beta seems to work OK, BUT. -# * If you have a package called 'docbook-xml-website' it's reported -# to prevent the build from working. Remove it. (Suse) -# * Sun Java seems to be required. GCJ 1.4.2 doesn't work. You can -# force Sun Java to be used by creating ~/.foprc with 'rpm_mode=' (Fedora) -# Get it from http://www.java.com -# The Hyphenation package must be obtained from your distribution or -# the project site at http://offo.sourceforge.net/ - be sure to get the -# version that corresponds to the version of FOP that you used above. -# -# -# The docbook XSL must be 1.71.1 or higher. -# * Remember to update /etc/xml/catalogs if you manually update this. -# - -gpsbabel.html.depends = gpsbabel FORCE -equals(PWD, $${OUT_PWD}) { - gpsbabel.html.commands += tools/make_gpsbabel_html.sh -} else { - gpsbabel.html.commands += echo "target gpsbabel.html is not supported for out of source builds."; - gpsbabel.html.commands += exit 1; -} -QMAKE_EXTRA_TARGETS += gpsbabel.html - -gpsbabel.pdf.depends = gpsbabel FORCE -equals(PWD, $${OUT_PWD}) { - gpsbabel.pdf.commands += tools/make_gpsbabel_pdf.sh -} else { - gpsbabel.pdf.commands += echo "target gpsbabel.pdf is not supported for out of source builds."; - gpsbabel.pdf.commands += exit 1; -} -QMAKE_EXTRA_TARGETS += gpsbabel.pdf - -gui.depends = $(TARGET) FORCE -disable-mappreview { - guiconfig = "CONFIG+=disable-mappreview" -} -gui.commands += cd gui; $(QMAKE) $${guiconfig} app.pro && $(MAKE) -QMAKE_EXTRA_TARGETS += gui - -unix-gui.depends = gui FORCE -unix-gui.commands += cd gui; $(MAKE) package -QMAKE_EXTRA_TARGETS += unix-gui - -toolinfo.depends = FORCE -toolinfo.commands += $(CC) --version; -toolinfo.commands += $(CXX) --version; -toolinfo.commands += $(QMAKE) -v; -QMAKE_EXTRA_TARGETS += toolinfo - diff --git a/INSTALL b/INSTALL index 38e4e7828..d2de7f464 100644 --- a/INSTALL +++ b/INSTALL @@ -1,14 +1,21 @@ -The autotools based build system (configure) is no longer supported and has -been removed. +The only build system generator supported is cmake. The autotools based build +system (configure) and the qmake based build system are no longer supported +and have been removed. -The use of cmake is experimental. The implementation is not complete. It is -untested by continuous integration. It is not recommended for production use. +The Ninja generator is recommended and tested in continuous integration. +The Visual Studio 16 2019, Visual Studio 17 2022 and Xcode generators are +also tested in continuous integration. -The recommended build uses Qt's qmake: +An example to build the command line client gpsbabel and the graphical +user interface gpsbabelfe from the top level directory is: +mkdir bld; +cd bld; +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/path/to/Qt -G Ninja .. +cmake --build . -The following options may be set on the qmake command line. +The following cache variables can be used to control the build: -WITH_LIBUSB=no|pkgconfig|system*|included*|custom +GPSBABEL_WITH_LIBUSB:STRING=no|pkgconfig|system*|included*|custom note that libusb is NOT used on windows. no: build without libusb-1.0. functionality will be limited. pkgconfig: build with libusb-1.0 found by pkg-config. @@ -16,39 +23,66 @@ WITH_LIBUSB=no|pkgconfig|system*|included*|custom libusb-1.0 on system include path (default, linux, openbsd). included: build with libusb-1.0 included with gpsbabel (default, macOS only). custom: build with user supplied libusb-1.0. LIBS and INCLUDEPATH may need to - be set, e.g. LIBS+=... INCLUDEPATH+=... + be set with GPSBABEL_EXTRA_LINK_LIBRARIES and + GPSBABEL_EXTRA_INCLUDE_DIRECTORIES. -WITH_SHAPELIB=no|pkgconfig|included*|custom +GPSBABEL_WITH_SHAPELIB:STRING=no|pkgconfig|included*|custom no: build without shapelib. functionality will be limited. pkgconfig: build with shapelib found by pkg-config. included: build with shapelib included with gpsbabel (default). custom: build with user supplied shapelib. LIBS and INCLUDEPATH may need to - be set, e.g. LIBS+=... INCLUDEPATH+=... + be set with GPSBABEL_EXTRA_LINK_LIBRARIES and + GPSBABEL_EXTRA_INCLUDE_DIRECTORIES. -WITH_ZLIB=no|pkgconfig|included*|custom +GPSBABEL_WITH_ZLIB:STRING=no|pkgconfig|included*|custom no: build without zlib. functionality will be limited. pkgconfig: build with zlib found by pkg-config. included: build with zlib included with gpsbabel (default). custom: build with user supplied zlib. LIBS and INCLUDEPATH may need to be - set, e.g. LIBS+=... INCLUDEPATH+=... + set with GPSBABEL_EXTRA_LINK_LIBRARIES and + GPSBABEL_EXTRA_INCLUDE_DIRECTORIES. -CONFIG+=disable-mappreview - This options disables the map preview feature. With the feature disabled +GPSBABEL_MAPPREVIEW=ON*|OFF + This options enables the map preview feature. With the feature disabled QtWebEngine and QtWebEngineWdigets are not used. Note that QtWebKit and QtWebKitWidgets are not longer supported. -DOCVERSION=... +GPSBABEL_EMBED_MAP:BOOL=ON|OFF + Embed gmapbase.html for map preview. When using this option gmapbase.html + will be compiled into the executable and does not need to be distributed. + +GPSBABEL_EMBED_TRANSLATIONS:BOOL:ON|OFF + Embed translations. When using this option the gpsbabel provided + translations will be compiled into the executable and do not need to be + distributed. The Qt provided translations still need to be distributed. + +GPSBABEL_ENABLE_PCH:BOOL + Enable precompiled headers when building the target gpsbabel. + +GPSBABEL_EXTRA_COMPILE_OPTIONS:STRING + Extra compile options when building the target gpsbabel. + +GPSBABEL_EXTRA_INCLUDE_DIRECTORIES:STRING + Extra directories to include when building the target gpsbabel. + +GPSBABEL_EXTRA_LINK_LIBRARIES:STRING + Extra libraries to link when building the target gpsbabel. + +GPSBABEL_EXTRA_LINK_OPTIONS:STRING + Extra link options when building the target gpsbabel. + +DOCVERSION:STRING=... string appended to documentation location for www.gpsbabel.org. The default value is the version string, e.g. "1.7.0". This is used by the gpsbabel.org target, you are unlikely to need it unless you are maintaining www.gpsbabel.org. -WEB=DIR +WEB:STRING=DIR Path where the documentation will be stored for www.gpsbabel.org. This is used by the gpsbabel.org target, you are unlikely to need it unless you are maintaining www.gpsbabel.org. The default location is "../babelweb" -Make targets: +Targets: check: Run the basic test suite. check-vtesto: Run valgrind memcheck. @@ -56,12 +90,14 @@ gpsbabel: Build the command line tool. gpsbabel.hmtl: Create the html documentation. gpsbabel.org: Create documentation for use on www.gpsbabel.org. gpsbabel.pdf: Create the pdf documentation. -gui: Build the graphical user interface. -unix-gui: Build the graphical user interface and collect the components for - distribution. On Linux the gpsbabel generated components will be under +gpsbabelfe: Build the graphical user interface. +package_app: Collect the components for distribution. + On Linux the gpsbabel generated components will be under gui/GPSBabelFE, any dynamically linked required libraries are not included. On macOS an app bundle will be created at gui/GPSBabelFE.app and an apple disk image will be created at gui/GPSBabelFE.dmg. + On windows an image will be created in the directory gui/package, and an + installer will be created gui/Setup-x.y.z-Setup.exe. Dependencies: On non-macOS unix builds by default we now compile in the gpsbabel generated @@ -71,8 +107,3 @@ These are used by the GUI. Additional translation files from Qt will also be used if they are found. They may be in a package such as qttranslations5-l10n or qt5-qttranslations. -Windows builds: - Two build methods are supported with MSVC tools. - 1. "qmake -tp vc" will create a visual studio project that can be built with msbuild. - 2. "qmake" will create a Makefile that can be built with nmake. - diff --git a/gbversion.h.in b/gbversion.h.in index d73146d1b..de72d684d 100644 --- a/gbversion.h.in +++ b/gbversion.h.in @@ -11,7 +11,7 @@ #define VER_PRODUCT @GB.MAJOR@,@GB.MINOR@,@GB.MICRO@,@GB.BUILD@ #define VER_FILE_STR "@GB.MAJOR@.@GB.MINOR@.@GB.MICRO@@GB.PACKAGE_RELEASE@" #define VER_PRODUCT_STR "@GB.MAJOR@.@GB.MINOR@.@GB.MICRO@@GB.PACKAGE_RELEASE@" -#define VER_COPYRIGHT_YEAR @GB.COPYRIGHT_YEAR@ +#define VER_COPYRIGHT_STR L"\x00a9 2002-@GB.COPYRIGHT_YEAR@ Robert Lipe" #else #define VERSION "@GB.MAJOR@.@GB.MINOR@.@GB.MICRO@@GB.PACKAGE_RELEASE@" constexpr char kVersionSHA[] = "@GB.SHA@"; diff --git a/gbversion.h.qmake.in b/gbversion.h.qmake.in deleted file mode 100644 index 37c55f6ad..000000000 --- a/gbversion.h.qmake.in +++ /dev/null @@ -1,19 +0,0 @@ -/* - * gbversion.h is generated from gbversion.h.in which uses autoconf voodoo - * to get the version number from configure.ac. - * - * Isn\'t simplification via automation grand? - */ -#ifdef RC_INVOKED -// These defines are for the Microsoft resource compiler scripts -// win32/gpsbabel.rc and gui/app.rc -#define VER_FILE $${GB.MAJOR},$${GB.MINOR},$${GB.MICRO},$${GB.BUILD} -#define VER_PRODUCT $${GB.MAJOR},$${GB.MINOR},$${GB.MICRO},$${GB.BUILD} -#define VER_FILE_STR \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\" -#define VER_PRODUCT_STR \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\" -#define VER_COPYRIGHT_YEAR $${GB.COPYRIGHT_YEAR} -#else -#define VERSION \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\" -constexpr char kVersionSHA[] = \"$${GB.SHA}\"; -#define WEB_DOC_DIR \"https://www.gpsbabel.org/htmldoc-$${DOCVERSION}\" -#endif diff --git a/gbversion.pri b/gbversion.pri deleted file mode 100644 index 1b5f66649..000000000 --- a/gbversion.pri +++ /dev/null @@ -1,38 +0,0 @@ -# Use GB variable to express ownership intention and avoid conflict with -# documented and undocumented qmake variables. - -# Until we do a hierarchical build the build directory for gpsbabel and -# the build directory for GPSBabelFE are independent. Only the source -# directories have a known relationship. Including this pri file from the -# source tree will generate the version file in the current build directory. - -# Note some of these variables are also used in the gui to generate setup.iss. -# Note some of these variables are also used in the cli to generate documents. - -# FIXME: Today we have multiple independent .pro files. By defining -# the version here we minimize the number of locations containing the -# definition to gbversion.pri and gbversion.cmake. When we retire qmake -# we will be back to only one place for version to be defined. - -GB.VERSION = 1.8.0 # Also change in gbversion.cmake -GB.VERSION_COMPONENTS = $$split(GB.VERSION, .) -GB.MAJOR = $$member(GB.VERSION_COMPONENTS, 0) -GB.MINOR = $$member(GB.VERSION_COMPONENTS, 1) -GB.MICRO = $$member(GB.VERSION_COMPONENTS, 2) -# Increase GB.BUILD for a new release (why? Where is this ever used?) -# A: it's used by win32/gpsbabel.rc which includes gbversion.h -GB.BUILD = 32 -# GB.PACKAGE_RELEASE = "-beta20190413" -GB.SHA = $$(GITHUB_SHA) -GB.COPYRIGHT_YEAR = 2022 - -# may be overridden on qmake command line -!defined(DOCVERSION, var) { -DOCVERSION=$${GB.VERSION} -} - -# use undocumented QMAKE_SUBSTITUTES variable to emulate AC_CONFIG_FILES -# Note $${PWD} is relative to the location of this file. -GB.versionfile.input = $${PWD}/gbversion.h.qmake.in -GB.versionfile.output = gbversion.h -QMAKE_SUBSTITUTES += GB.versionfile diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 8f89ef773..97062e8a9 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -177,7 +177,6 @@ find_package(Qt${QT_VERSION_MAJOR} QUIET COMPONENTS LinguistTools) if (NOT Qt${QT_VERSION_MAJOR}LinguistTools_FOUND) message(WARNING "Qt${QT_VERSION_MAJOR}LinguistTools not found, gpsbabelfe translations cannot be updated or released, and application cannot be packaged.") else() -# FIXME: remove reliance an app.pro in package_app script. # FIXME: translations updated and released in source directory (and under version control). list(APPEND TRANSLATIONS gpsbabelfe_de.ts) list(APPEND TRANSLATIONS gpsbabelfe_es.ts) @@ -201,7 +200,7 @@ else() if(APPLE) get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION) add_custom_target(package_app - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/package_app -a $ -l -q ${_qmake_executable} -g $ -s ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/package_app -a $ -q ${_qmake_executable} -g $ -s ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${CMAKE_COMMAND} -E copy $/../GPSBabelFE.dmg ${CMAKE_CURRENT_BINARY_DIR} DEPENDS gpsbabelfe gpsbabel gpsbabelfe_lrelease coretool_lrelease VERBATIM @@ -209,7 +208,7 @@ else() elseif(UNIX) get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION) add_custom_target(package_app - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/package_app -a $ -l -q ${_qmake_executable} -g $ -s ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/package_app -a $ -q ${_qmake_executable} -g $ -s ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS gpsbabelfe gpsbabel gpsbabelfe_lrelease coretool_lrelease VERBATIM USES_TERMINAL) diff --git a/gui/app.pro b/gui/app.pro deleted file mode 100755 index a4ea0dfab..000000000 --- a/gui/app.pro +++ /dev/null @@ -1,170 +0,0 @@ -# $Id: app.pro,v 1.19 2010-11-01 03:30:42 robertl Exp $ -# - -# set VERSION related variables and generate gbversion.h -include(../gbversion.pri) - -GB.setupfile.input = setup.iss.qmake.in -GB.setupfile.output = setup.iss -QMAKE_SUBSTITUTES += GB.setupfile - -VERSION = $$GB.VERSION - -#CONFIG += qt causes link failure on msvc. Qt6EntryPoint.lib not added to libs. -CONFIG(debug, debug|release) { - CONFIG += console -} -CONFIG += c++17 - -ICON = images/appicon.icns - -QT += core \ - gui \ - network \ - serialport \ - widgets \ - xml - -disable-mappreview { - DEFINES += DISABLE_MAPPREVIEW -} else { - QT += webenginewidgets webchannel -} - -unix:DESTDIR = objects -unix:MOC_DIR = objects -unix:OBJECTS_DIR = objects -unix:RCC_DIR = objects -unix:!mac:DESTDIR = GPSBabelFE -mac:DESTDIR = . - -UI_DIR = tmp - -unix:!mac{ - TARGET=gpsbabelfe -} else { - TARGET=GPSBabelFE -} - -win32-g++ { - QMAKE_LFLAGS_RELEASE += -static-libgcc -} - -# Set QMAKE_TARGET_BUNDLE_PREFIX so we get the correct CFBundleIdentifier in Info.plist -darwin:QMAKE_TARGET_BUNDLE_PREFIX=org.gpsbabel - -# RESOURCES -RESOURCES = app.qrc -RC_FILE = app.rc - -# FORMS -FORMS += aboutui.ui -FORMS += advui.ui -FORMS += donate.ui -FORMS += filterui.ui -!disable-mappreview { - FORMS += gmapui.ui -} -FORMS += mainwinui.ui -FORMS += miscfltui.ui -FORMS += preferences.ui -FORMS += rttrkui.ui -FORMS += trackui.ui -FORMS += upgrade.ui -FORMS += version_mismatch.ui -FORMS += wayptsui.ui - -# SOURCES -SOURCES += aboutdlg.cc -SOURCES += advdlg.cc -SOURCES += donate.cc -SOURCES += dpencode.cc -SOURCES += filterdata.cc -SOURCES += filterdlg.cc -SOURCES += filterwidgets.cc -SOURCES += format.cc -SOURCES += formatload.cc -!disable-mappreview{ - SOURCES += gmapdlg.cc - SOURCES += gpx.cc -} -SOURCES += help.cc -SOURCES += latlng.cc -SOURCES += main.cc -SOURCES += mainwindow.cc -!disable-mappreview{ - SOURCES += map.cc -} -SOURCES += optionsdlg.cc -SOURCES += preferences.cc -SOURCES += processwait.cc -SOURCES += runmachine.cc -SOURCES += upgrade.cc -SOURCES += version_mismatch.cc -unix { - SOURCES += serial_unix.cc -} else:windows { - SOURCES += serial_win.cc -} - -# HEADERS -HEADERS += aboutdlg.h -HEADERS += advdlg.h -HEADERS += appname.h -HEADERS += babeldata.h -HEADERS += donate.h -HEADERS += filterdata.h -HEADERS += filterdlg.h -HEADERS += filterwidgets.h -HEADERS += format.h -HEADERS += formatload.h -!disable-mappreview { - HEADERS += gmapdlg.h - HEADERS += gpx.h -} -HEADERS += help.h -HEADERS += mainwindow.h -!disable-mappreview { - HEADERS += map.h -} -HEADERS += optionsdlg.h -HEADERS += preferences.h -HEADERS += processwait.h -HEADERS += runmachine.h -HEADERS += setting.h -HEADERS += upgrade.h -HEADERS += version_mismatch.h - -TRANSLATIONS += gpsbabelfe_ru.ts -TRANSLATIONS += gpsbabelfe_de.ts -TRANSLATIONS += gpsbabelfe_es.ts -TRANSLATIONS += gpsbabelfe_fr.ts -TRANSLATIONS += gpsbabelfe_hu.ts -TRANSLATIONS += gpsbabelfe_it.ts - -unix:!mac { - !defined(EMBED_TRANSLATIONS, var):EMBED_TRANSLATIONS = on - !defined(EMBED_MAP, var):EMBED_MAP = on -} -equals(EMBED_TRANSLATIONS, on) { - RESOURCES += translations.qrc -} -equals(EMBED_MAP, on) { - RESOURCES += map.qrc -} - -macx|linux{ - package.commands = QMAKE=$(QMAKE) ./package_app - package.depends = $(TARGET) - QMAKE_EXTRA_TARGETS += package -} -linux: QMAKE_DISTCLEAN += -r GPSBabelFE - -# build the compilation data base used by clang tools including clang-tidy, -# as well as CLion. -macx|linux{ - compile_command_database.target = compile_commands.json - compile_command_database.commands = make clean; bear make - QMAKE_EXTRA_TARGETS += compile_command_database - QMAKE_DISTCLEAN += compile_commands.json -} diff --git a/gui/app.rc b/gui/app.rc index fd6768910..981d6e64e 100644 --- a/gui/app.rc +++ b/gui/app.rc @@ -1,10 +1,6 @@ #include #include "gbversion.h" -#define stringize_(S) #S -#define stringize(S) stringize_(S) -#define copyright_str(YEAR) stringize(\xa9 2002-##YEAR Robert Lipe) - IDI_ICON1 ICON "images/appicon.ico" VS_VERSION_INFO VERSIONINFO @@ -28,7 +24,7 @@ BEGIN VALUE "FileDescription", "GPS format converter" VALUE "FileVersion", VER_FILE_STR VALUE "InternalName", "GPSBabelFE.exe" - VALUE "LegalCopyright", copyright_str(VER_COPYRIGHT_YEAR) + VALUE "LegalCopyright", VER_COPYRIGHT_STR VALUE "OriginalFilename", "GPSBabelFE.exe" VALUE "ProductName", "GPSBabel" VALUE "ProductVersion", VER_PRODUCT_STR diff --git a/gui/coretool/core.pro b/gui/coretool/core.pro deleted file mode 100644 index ae6688d7f..000000000 --- a/gui/coretool/core.pro +++ /dev/null @@ -1,8 +0,0 @@ -HEADERS += core_strings.h - -TRANSLATIONS += gpsbabel_ru.ts -TRANSLATIONS += gpsbabel_de.ts -TRANSLATIONS += gpsbabel_es.ts -TRANSLATIONS += gpsbabel_fr.ts -TRANSLATIONS += gpsbabel_hu.ts -TRANSLATIONS += gpsbabel_it.ts diff --git a/gui/coretool/coretool.pro b/gui/coretool/coretool.pro deleted file mode 100644 index 459fe38ee..000000000 --- a/gui/coretool/coretool.pro +++ /dev/null @@ -1,51 +0,0 @@ -# -# This project extracts the strings from the command line tool -# that the GUI translates and updates the translation files for -# these strings. -# -CONFIG += console -CONFIG -= app_bundle - -QT -= gui -QT += core \ - widgets - -TEMPLATE = app - -DESTDIR=objects -OBJECTS_DIR=objects -# trick qmake into making objects directory by listing it as MOC_DIR. -MOC_DIR=objects - -DEFINES += GENERATE_CORE_STRINGS - -INCLUDEPATH += .. -SOURCES += ../formatload.cc -SOURCES += coretool.cc - -HEADERS += ../format.h -HEADERS += ../formatload.h - -core_strings.target = core_strings.h -core_strings.depends = $(TARGET) -core_strings.depends += ../../gpsbabel -core_strings.commands = $(COPY_FILE) ../../gpsbabel $(DESTDIR)gpsbabel && -core_strings.commands += ./$(TARGET) core_strings.h; -QMAKE_EXTRA_TARGETS += core_strings -QMAKE_DISTCLEAN += $(DESTDIR)gpsbabel - -# The line numbers are almost meaningless the way we generate corestrings.h, and we force everything to the same context. -# With line numbers and the similartext heuristic enabled translations can be copied from an old message to a new message, -# and marked as unfinished. The threshold for similar is low. -# These will be used by the application, even though they really need to be checked. -# Disable the similartext heuristic to avoid these mistranslations. -qtPrepareTool(LUPDATE, lupdate) -update.depends = core_strings.h -update.commands = $$LUPDATE -disable-heuristic similartext core.pro -QMAKE_EXTRA_TARGETS += update - -qtPrepareTool(LRELEASE, lrelease) -release.depends = update -release.commands = $$LRELEASE core.pro -QMAKE_EXTRA_TARGETS += release - diff --git a/gui/package_app b/gui/package_app index fc0c263e8..4b1588bf9 100755 --- a/gui/package_app +++ b/gui/package_app @@ -82,15 +82,14 @@ SKIP_UPDATE_RELEASE= GPSBABEL=../gpsbabel QMAKE=qmake SOURCEDIR=. -while getopts a:lg:q:s: name +while getopts a:g:q:s: name do case $name in a) APPDIR="$OPTARG";; - l) SKIP_UPDATE_RELEASE=1;; g) GPSBABEL="$OPTARG";; q) QMAKE="$OPTARG";; s) SOURCEDIR="$OPTARG";; - ?) printf "Usage: %s: [-a package_directory] [-g gpsbabel] [-l] [-q qmake] [-s source_directory]\n" "$0" + ?) printf "Usage: %s: [-a package_directory] [-g gpsbabel] [-q qmake] [-s source_directory]\n" "$0" exit 2;; esac done @@ -98,17 +97,9 @@ done APPDIR="$( cd "${APPDIR}" && pwd )" LCONVERT="$(${QMAKE} -query QT_INSTALL_BINS)/lconvert" -LUPDATE="$(${QMAKE} -query QT_INSTALL_BINS)/lupdate" -LRELEASE="$(${QMAKE} -query QT_INSTALL_BINS)/lrelease" MACDEPLOYQT="$(${QMAKE} -query QT_INSTALL_BINS)/macdeployqt" QT_INSTALL_TRANSLATIONS="$(${QMAKE} -query QT_INSTALL_TRANSLATIONS)" -if [ -z "${SKIP_UPDATE_RELEASE}" ]; then - # update our translations and compile them. - "${LUPDATE}" "${SOURCEDIR}/app.pro" - "${LRELEASE}" "${SOURCEDIR}/app.pro" -fi - if [ "${machine}" = "Linux" ]; then LANGDIR="${APPDIR}/translations" else diff --git a/gui/setup.iss.qmake.in b/gui/setup.iss.qmake.in deleted file mode 100644 index 62b8ae879..000000000 --- a/gui/setup.iss.qmake.in +++ /dev/null @@ -1,90 +0,0 @@ -; -; NOTE: setup.iss is generated from setup.iss.in via configure. -; The generated setup.iss is checked in to help keep the version numbers -; synchronized. -; -; Script for generating installation setup program for GPSBabel -; Uses the Inno setup compiler. -; windeployqt should be run to prepare the necessary Qt files before -; running Inno Setup. -#ifndef output_dir - #define output_dir \".\" -#endif -#ifndef source_dir - #define source_dir \".\" -#endif - -[Setup] -; NOTE: The value of AppId uniquely identifies this application. -; Do not use the same AppId value in installers for other applications. -; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{1B8FE958-A304-4902-BF7A-4E2F0F5B7017} -AppName=GPSBabel -AppVerName=GPSBabel $${GB.VERSION}$${GB.PACKAGE_RELEASE} -AppPublisher=GPSBabel -AppPublisherURL=https://www.gpsbabel.org -AppSupportURL=https://www.gpsbabel.org -AppUpdatesURL=https://www.gpsbabel.org -ArchitecturesAllowed=x64 -ArchitecturesInstallIn64BitMode=x64 -DefaultDirName={pf}\\GPSBabel -DefaultGroupName=GPSBabel -OutputDir=\"{#output_dir}\" -OutputBaseFilename=GPSBabel-$${GB.VERSION}$${GB.PACKAGE_RELEASE}-Setup -OutputManifestFile=GPSBabel-$${GB.VERSION}$${GB.PACKAGE_RELEASE}-Manifest.txt -SetupIconFile=images\\babel2.ico -Compression=lzma -SolidCompression=yes -SourceDir=\"{#source_dir}\" -LicenseFile=COPYING.txt - -[Languages] -Name: \"english\"; MessagesFile: \"compiler:Default.isl\" - -[Tasks] -Name: \"desktopicon\"; Description: \"{cm:CreateDesktopIcon}\"; GroupDescription: \"{cm:AdditionalIcons}\"; Flags: unchecked - -[Files] -Source: gmapbase.html; DestDir: \"{app}\"; Flags: ignoreversion -Source: qt.conf; DestDir: \"{app}\"; Flags: ignoreversion - -Source: \"{#output_dir}\\package\\*\"; Excludes: \"vc_redist.*.exe\"; DestDir: \"{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: \"{#output_dir}\\package\\vc_redist.x86.exe\"; DestDir: \"{app}\"; Flags: ignoreversion skipifsourcedoesntexist deleteafterinstall -Source: \"{#output_dir}\\package\\vc_redist.x64.exe\"; DestDir: \"{app}\"; Flags: ignoreversion skipifsourcedoesntexist deleteafterinstall -Source: \"{#output_dir}\\package\\gpsbabel.exe\"; DestDir: \"{app}\"; Flags: ignoreversion -; Source: release\\help\\*; DestDir: \"{app}\\help\"; Flags: ignoreversion recursesubdirs createallsubdirs - -; Translation strings extracted from source code. Include it in the dist -; so that users can translate if they want to. -; Source: gpsbabel_*.ts; DestDir: \"{app}\\translations\"; Flags: ignoreversion -; Source: gpsbabelfe_*.ts; DestDir: \"{app}\\translations\"; Flags: ignoreversion - -; Compiled translation strings that are used at runtime. -Source: coretool\\gpsbabel_*.qm; DestDir: \"{app}\\translations\"; Flags: ignoreversion -Source: gpsbabelfe_*.qm; DestDir: \"{app}\\translations\"; Flags: ignoreversion - -; Miscellaneous -Source: COPYING.txt; DestDir: {app}; Flags: ignoreversion -; Source: AUTHORS; DestDir: {app}; Flags: ignoreversion -; Source: README.contrib; DestDir: {app}; Flags: ignoreversion -; Source: README.gui; DestDir: {app}; Flags: ignoreversion - - -; NOTE: Don\'t use \"Flags: ignoreversion\" on any shared system files - -[Icons] -Name: \"{group}\\GPSBabel\"; Filename: \"{app}\\gpsbabelfe.exe\" -Name: \"{commondesktop}\\GPSBabel\"; Filename: \"{app}\\gpsbabelfe.exe\"; Tasks: desktopicon - -[Run] -Filename: \"{app}\\vc_redist.x86.exe\"; Parameters: \"/quiet\"; Flags: skipifdoesntexist -Filename: \"{app}\\vc_redist.x64.exe\"; Parameters: \"/quiet\"; Flags: skipifdoesntexist -Filename: \"{app}\\gpsbabelfe.exe\"; Description: \"{cm:LaunchProgram,GPSBabelFE}\"; Flags: nowait postinstall skipifsilent - -[Registry] -Root: HKCU; Subkey: \"Software\\GPSBabel\"; Flags: uninsdeletekeyifempty -Root: HKCU; Subkey: \"Software\\GPSBabel\\GPSBabel\"; Flags: uninsdeletekey -Root: HKCU; Subkey: \"Software\\GPSBabel\\GPSBabelFE\"; Flags: uninsdeletekey - -; ISPP preprocessor output can be useful for debug -#expr SaveToFile(\"PreprocessedScript.iss\") diff --git a/libusb.pri b/libusb.pri deleted file mode 100644 index 4b8cc2ee7..000000000 --- a/libusb.pri +++ /dev/null @@ -1,66 +0,0 @@ -unix { - !defined(WITH_LIBUSB, var) { - mac: WITH_LIBUSB = included - !mac: WITH_LIBUSB = system - } - equals(WITH_LIBUSB, no) { - message("libusb-1.0 disabled") - JEEPS += jeeps/gpsusbstub.cc - } else { - DEFINES += HAVE_LIBUSB_1_0 - JEEPS += jeeps/gpslibusb.cc - equals(WITH_LIBUSB, pkgconfig) { - message("Using libusb-1.0 found by pkg-config") - PKGCONFIG += libusb-1.0 - DEFINES += LIBUSB_H_INCLUDE=$$shell_quote() - } else { - !mac { - equals(WITH_LIBUSB, system) { - LIBS += "-lusb-1.0" - DEFINES += LIBUSB_H_INCLUDE=$$shell_quote() - } else:equals(WITH_LIBUSB, custom) { - message("libusb-1.0 is enabled but but must be manually configured") - message(" e.g. qmake WITH_LIBUSB=custom LIBS+=... INCLUDEPATH+=...") - DEFINES += LIBUSB_H_INCLUDE=$$shell_quote() - } else { - error("WITH_LIBUSB=no|pkgconfig|system*|custom"); - } - } - - mac { - equals(WITH_LIBUSB, included) { - # TODO: It would be better to create an archive and link to it - # to separate library build requirements from gpsbabel requirements. - DEFINES += LIBUSB_H_INCLUDE=$$shell_quote(\"mac/libusb/libusb.h\") - LIBS += -lobjc -framework IOKit -framework CoreFoundation -framework Security - INCLUDEPATH += mac/libusb \ - mac/libusb/Xcode - SOURCES += \ - mac/libusb/core.c \ - mac/libusb/descriptor.c \ - mac/libusb/hotplug.c \ - mac/libusb/io.c \ - mac/libusb/strerror.c \ - mac/libusb/sync.c \ - mac/libusb/os/darwin_usb.c \ - mac/libusb/os/events_posix.c \ - mac/libusb/os/threads_posix.c - HEADERS += \ - mac/libusb/libusb.h \ - mac/libusb/libusbi.h \ - mac/libusb/version.h \ - mac/libusb/version_nano.h \ - mac/libusb/os/darwin_usb.h \ - mac/libusb/os/events_posix.h \ - mac/libusb/os/threads_posix.h - } else:equals(WITH_LIBUSB, custom) { - message("libusb-1.0 is enabled but but must be manually configured") - message(" e.g. qmake WITH_LIBUSB=custom LIBS+=... INCLUDEPATH+=...") - DEFINES += LIBUSB_H_INCLUDE=$$shell_quote() - } else { - error("WITH_LIBUSB=no|pkgconfig|included*|custom"); - } - } - } - } -} diff --git a/mac/libusb/libusb.pro b/mac/libusb/libusb.pro deleted file mode 100644 index 192d06fe3..000000000 --- a/mac/libusb/libusb.pro +++ /dev/null @@ -1,33 +0,0 @@ -# Were using qmake to build a library that has nothing to do with Qt. -# Dummy out qt defaults. -QT -= gui -QT -= core - -CONFIG += staticlib -TEMPLATE = lib - -TARGET = usb-1.0 - -SOURCES = core.c \ - descriptor.c \ - hotplug.c \ - io.c \ - strerror.c \ - sync.c \ - os/darwin_usb.c \ - os/events_posix.c \ - os/threads_posix.c - -HEADERS = libusb.h \ - libusbi.h \ - version.h \ - version_nano.h \ - os/darwin_usb.h \ - os/events_posix.h \ - os/threads_posix.h - -# We use libusb-1.0.0's hardcoded config.h for Xcode -# Note that we want don't want the path containing the Xcode config.h -# to be found when building gpsbabel, i.e. it can't be next to libusb.h. -INCLUDEPATH = Xcode - diff --git a/shapelib.pri b/shapelib.pri deleted file mode 100644 index 4a0c8df46..000000000 --- a/shapelib.pri +++ /dev/null @@ -1,26 +0,0 @@ -!defined(WITH_SHAPELIB, var):WITH_SHAPELIB = included -equals(WITH_SHAPELIB, no) { - message("shapelib disabled") -} else { - DEFINES += SHAPELIB_ENABLED - equals(WITH_SHAPELIB, pkgconfig) { - message("Using shapelib found by pkg-config") - PKGCONFIG += shapelib - DEFINES += HAVE_LIBSHAPE - } else:equals(WITH_SHAPELIB, included) { - # TODO: It would be better to create an archive and link to it - # to separate library build requirements from gpsbabel requirements. - SOURCES += \ - shapelib/dbfopen.c \ - shapelib/safileio.c \ - shapelib/shpopen.c - HEADERS += \ - shapelib/shapefil.h - } else:equals(WITH_SHAPELIB, custom) { - message("shapelib is enabled but but must be manually configured") - message(" e.g. qmake WITH_SHAPELIB=custom LIBS+=... INCLUDEPATH+=...") - DEFINES += HAVE_LIBSHAPE - } else { - error("WITH_SHAPELIB=no|pkgconfig|included*|custom"); - } -} diff --git a/tools/Dockerfile_f32 b/tools/Dockerfile_f32 index 9a775a7d0..24e355661 100644 --- a/tools/Dockerfile_f32 +++ b/tools/Dockerfile_f32 @@ -7,7 +7,7 @@ LABEL maintainer="https://github.com/tsteven4" WORKDIR /app # basic tools to build -RUN dnf install --assumeyes git make valgrind diffutils findutils langpacks-en && \ +RUN dnf install --assumeyes git make valgrind diffutils findutils langpacks-en ninja-build && \ dnf clean all # libraries used by gpsbabel. zlib and shapelib may or may not be used depending qmake options. RUN dnf install --assumeyes libusbx-devel zlib-devel shapelib-devel && \ diff --git a/tools/Dockerfile_f35 b/tools/Dockerfile_f35 index 6561ca0fb..b89016683 100644 --- a/tools/Dockerfile_f35 +++ b/tools/Dockerfile_f35 @@ -7,7 +7,7 @@ LABEL maintainer="https://github.com/tsteven4" WORKDIR /app # basic tools to build -RUN dnf install --assumeyes git make valgrind diffutils findutils langpacks-en && \ +RUN dnf install --assumeyes git make valgrind diffutils findutils langpacks-en ninja-build && \ dnf clean all # libraries used by gpsbabel. zlib and shapelib may or may not be used depending qmake options. RUN dnf install --assumeyes libusb1-devel zlib-devel shapelib-devel && \ diff --git a/tools/build_and_test.sh b/tools/build_and_test.sh deleted file mode 100755 index 9993e7bfd..000000000 --- a/tools/build_and_test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -ex -# -# this script is triggered by SCM changes and is run on the build server. -# output is conditionally mailed to gpsbabel-code. -# -# echo some system info to log -uname -a -if [ -e /etc/system-release ]; then - cat /etc/system-release -fi -if [ -e /etc/os-release ]; then - cat /etc/os-release -fi -git --no-pager log -n 1 -# build and test keeping output within the pwd. -export GBTEMP=$(pwd)/gbtemp -mkdir -p "$GBTEMP" -qmake WEB="$(pwd)/gpsbabel_docdir" -# As of 2018-10, all the virtualized travis build images are two cores per: -# https://docs.travis-ci.com/user/reference/overview/ -# We'll be slightly abusive on CPU knowing that I/O is virtualized. -make toolinfo -make clean -make -j 3 -make -j 3 unix-gui -make gpsbabel.html -make gpsbabel.pdf -make gpsbabel.org -make check -# test for mangled encoding of command line arguments -./test_encoding_latin1 -./test_encoding_utf8 -#make torture -make -k -j2 check-vtesto -# eat the verbose output from test-all, including crash.output -# this is a bit risky, if test-all generates an error we won't see what happened. -echo "test-all in progress... (read/write test between all possible formats)" -(LIBC_FATAL_STDERR_=1; export LIBC_FATAL_STDERR_; ./test-all -s -r reference/expertgps.gpx >/dev/null 2>&1) -# summarize the test-all results, and generate an error if a fatal error was -# detected by test-all. -./test-all -J diff --git a/tools/make_windows_release.ps1 b/tools/make_windows_release.ps1 deleted file mode 100755 index 18bcc6766..000000000 --- a/tools/make_windows_release.ps1 +++ /dev/null @@ -1,103 +0,0 @@ -# Script to build and create windows installer. -# -# Run this from a Qt Desktop command window that has the Qt and mingw compiler paths set up, -# such as the one Qt Creator will put on the start menu. -# For example, to run overriding the default locations of windeployqt and ISSC: -# powershell.exe -ExecutionPolicy Unrestricted -File tools\make_windows_release.ps1 -windeployqt "C:\Qt\5.6.3\mingw49_32\bin\windeployqt.exe" -iscc "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" -flow mingw -# Or to do a 64 bit MSVC build with a newer Qt: -# powershell.exe -ExecutionPolicy Unrestricted -File tools\make_windows_release.ps1 -iscc "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" -gpsbabel_build_dir_name "build-GPSBabel-Desktop_Qt_5_9_3_MSVC2015_64bit-Release" -gui_build_dir_name "build-app-Desktop_Qt_5_9_3_MSVC2015_64bit-Release" -# -# Be aware this script is used by appveyor.yml -# -# The defaults should be compatible with appveyor builds. -Param( - $windeployqt = "windeployqt.exe", - $iscc = "C:\Program Files (x86)\Inno Setup 5\ISCC.exe", - $gpsbabel_build_dir_name = "bld", - [ValidateSet("mingw", "msbuild", "nmake")] $flow = "nmake", - $buildinstaller = "false", - [ValidateSet("x86", "amd64", "amd64_x86", "x86_amd64")] $arch = "amd64" -) -# the arch parameter values correspond to: -# vcvarsall arch parameter x86 => host x86, target x86. -# vcvarsall arch paramter amd64 => host amd64, target amd64. -# vcvarsall arch parameter amd64_x86 => host amd64, target x86 -# vcvarsall arch parameter x86_amd64 => host x86, target amd64 -# vsdevcmd arch parameter x86 => target x86. -# vsdevcmd arch parameter amd64 => target amd64. -$ErrorActionPreference = "Stop" -# verify we are in the top of the gpsbabel clone -Get-Item tools/make_windows_release.ps1 -ErrorAction Stop | Out-Null -$gpsbabel_src_dir = "$Pwd" -$gpsbabel_build_dir = "$($gpsbabel_src_dir)\$($gpsbabel_build_dir_name)" -$gui_build_dir = "$($gpsbabel_build_dir)\gui" -if ( "$flow" -eq "msbuild" ) { - # translate target architecture to Platform property value. - switch ($arch) { - "x86" { $platform = "Win32" } - "amd64" { $platform = "x64" } - "amd64_x86" { $platform = "Win32" } - "x86_amd64" { $platform = "x64" } - } -} -# mimic creator shadow build to match Inno setup file -# make sure we are staring with a clean build directory -Remove-Item "$($gpsbabel_build_dir)" -Recurse -ErrorAction Ignore -New-Item "$($gpsbabel_build_dir)" -type directory -Force | Out-Null -Set-Location "$($gpsbabel_build_dir)" -switch ($flow) { - "mingw" { qmake "$($gpsbabel_src_dir)\GPSBabel.pro" -spec "win32-g++" } - # work around Qt 5.12.1, 5.12.2 qmake bug. - #C:\Qt\5.12.1\msvc2017\bin\qmake.exe -tp vc GPSBabel.pro - #WARNING: Could not parse Compiler option '-std:c++14'; added to AdditionalOptions. - #WARNING: You can suppress these warnings with CONFIG+=suppress_vcproj_warnings. - #WARNING: Could not parse Compiler option '-std:c++14'; added to AdditionalOptions. - "msbuild" { $ErrorActionPreference = "Continue"; qmake -tp vc "$($gpsbabel_src_dir)\GPSBabel.pro"; $ErrorActionPreference = "Stop" } - "nmake" { qmake "$($gpsbabel_src_dir)\GPSBabel.pro" -spec "win32-msvc" } -} -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -switch ($flow) { - "mingw" { ming32-make } - "msbuild" { msbuild GPSBabel.vcxproj -property:Configuration=Release -property:Platform=$platform } - "nmake" { nmake /NOLOGO } -} -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -# make sure we are staring with a clean build directory -Remove-Item "$($gui_build_dir)" -Recurse -ErrorAction Ignore -New-Item "$($gui_build_dir)" -type directory -Force | Out-Null -Set-Location "$($gui_build_dir)" -switch ($flow) { - "mingw" { qmake "$($gpsbabel_src_dir)\gui\app.pro" -spec "win32-g++" } - "msbuild" { qmake -tp vc "$($gpsbabel_src_dir)\gui\app.pro" } - "nmake" { qmake "$($gpsbabel_src_dir)\gui\app.pro" -spec "win32-msvc" } -} -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -switch ($flow) { - "mingw" { ming32-make } - "msbuild" { msbuild GPSBabelFE.vcxproj -property:Configuration=Release -property:Platform=$platform } - "nmake" { nmake /NOLOGO } -} -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -Set-Location "$($gui_build_dir)" -# work around errors with lupdate, lrelease misprocessing qtHaveModule(webenginewidgets) -# and generating a message to stderr WARNING: Project ERROR: Unknown module(s) in QT: webkit webkitwidgets -# and, on Windows, setting $? to false. -# (assuming they are not installed). -$ErrorActionPreference = "Continue" -lupdate "$($gpsbabel_src_dir)\gui\app.pro" -lrelease "$($gpsbabel_src_dir)\gui\app.pro" -$ErrorActionPreference = "Stop" -# deploy to a clean directory as different build systems create differently named debris in release. -Remove-Item "$($gui_build_dir)\package" -Recurse -ErrorAction Ignore -New-Item "$($gui_build_dir)\package" -type directory -Force | Out-Null -Copy-Item "$($gpsbabel_build_dir)\release\gpsbabel.exe" "$($gui_build_dir)\package\gpsbabel.exe" -Copy-Item "$($gui_build_dir)\release\GPSBabelFE.exe" "$($gui_build_dir)\package\GPSBabelFE.exe" -# use --plugindir option to locate the plugins. -& "$($windeployqt)" --verbose 1 --plugindir package\plugins package\GPSBabelFE.exe package\gpsbabel.exe -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -if ($buildinstaller -eq "true") { - # set location to location of generated setup.iss file. - & "$($iscc)" /Doutput_dir="$($gui_build_dir)" /Dsource_dir="$($gpsbabel_src_dir)\gui" setup.iss - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -} -Set-Location "$($gpsbabel_src_dir)" diff --git a/tools/nuke_format b/tools/nuke_format index d29da50e5..4598eb851 100755 --- a/tools/nuke_format +++ b/tools/nuke_format @@ -28,8 +28,6 @@ remove_manually() { remove_line $1.cc CMakeLists.txt remove_line $1.h CMakeLists.txt remove_line $1 CMakeLists.txt # for tests. -remove_line $1.cc GPSBabel.pro -remove_line $1.h GPSBabel.pro remove_line $1 gpsbabel.qrc remove_manually $1 reference/help.txt diff --git a/tools/reset_nuke b/tools/reset_nuke index 2080fc0f3..e7ff7526d 100755 --- a/tools/reset_nuke +++ b/tools/reset_nuke @@ -8,11 +8,10 @@ git checkout reference/format1.txt git checkout reference/format2.txt git checkout reference/format3.txt reference/help.txt -rm GPSBabel.pro vecs.h vecs.cc -# git rm GPSBabel.pro vecs.h -#git reset GPSBabel.pro +rm vecs.h vecs.cc +# git rm vecs.h #git reset vecs.h -git checkout GPSBabel.pro vecs.h vecs.cc +git checkout vecs.h vecs.cc # This part of the code devalues almot immediately once pushed upstream echo "Now re-killing formats to exercise the script. ^C to cancel. to ontinue" diff --git a/tools/travis_script_osx b/tools/travis_script_osx deleted file mode 100755 index f97a4a4ef..000000000 --- a/tools/travis_script_osx +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -ex -# -# this script is run on travis for the script stage of mac builds -# - -function version_ge() { test "$(printf "%s\n%s" $1 $2 | sort -rV | head -n 1)" == "$1"; } - -QMAKE=${QMAKE:-qmake} -LUPDATE=${LUPDATE:-lupdate} -LRELEASE=${LRELEASE:-lrelease} -MACDEPLOYQT=${MACDEPLOYQT:-macdeployqt} -# we assume we are on macOS, so date is not gnu date. -VERSIONID=${VERSIONID:-$(date -ju -f %Y-%m-%dT%H:%M:%S%z $(git show -s --format="%aI" HEAD | sed 's/:\(..\)$/\1/') +%Y%m%dT%H%MZ)-$(git rev-parse --short=7 HEAD)} - -# debug tokens -"$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"/ci_tokens - -# build and test the CLI -if version_ge $($QMAKE -query QT_VERSION) 6.0.0; then - $QMAKE GPSBabel.pro QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" -else - $QMAKE GPSBabel.pro -fi -make -j 3 -make check - -# build the GUI -pushd gui -if version_ge $($QMAKE -query QT_VERSION) 6.0.0; then - $QMAKE app.pro QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" -else - $QMAKE app.pro -fi -make -j 3 -make package -popd - -# what is in there? -hdiutil attach -noverify gui/GPSBabelFE.dmg -find /Volumes/GPSBabelFE -ls -hdiutil detach /Volumes/GPSBabelFE - -mv gui/GPSBabelFE.dmg gui/GPSBabel-${VERSIONID}.dmg - diff --git a/win32/gpsbabel.rc b/win32/gpsbabel.rc index 491de0baa..4b9096545 100644 --- a/win32/gpsbabel.rc +++ b/win32/gpsbabel.rc @@ -1,10 +1,6 @@ #include #include "gbversion.h" -#define stringize_(S) #S -#define stringize(S) stringize_(S) -#define copyright_str(YEAR) stringize(\xa9 2002-##YEAR Robert Lipe) - IDI_ICON1 ICON "gpsbabel.ico" VS_VERSION_INFO VERSIONINFO @@ -28,7 +24,7 @@ BEGIN VALUE "FileDescription", "GPS format converter" VALUE "FileVersion", VER_FILE_STR VALUE "InternalName", "gpsbabel.exe" - VALUE "LegalCopyright", copyright_str(VER_COPYRIGHT_YEAR) + VALUE "LegalCopyright", VER_COPYRIGHT_STR VALUE "OriginalFilename", "gpsbabel.exe" VALUE "ProductName", "GPSBabel" VALUE "ProductVersion", VER_PRODUCT_STR diff --git a/xmldoc/chapters/build.xml b/xmldoc/chapters/build.xml index e725bbce0..f0a6ee471 100644 --- a/xmldoc/chapters/build.xml +++ b/xmldoc/chapters/build.xml @@ -1,38 +1,39 @@ Getting or Building GPSBabel - -Downloading - the easy way. - + + Downloading - the easy way. + GPSBabel is distributed "ready to run" on most common operating systems via the download page. - As GPSBabel runs on a wide variety of operating systems, + As GPSBabel runs on a wide variety of operating systems, be sure to visit the OS-Specific notes for additional information. - - -Building from source. - - For operating systems where no binary is provided, or if + + + Building from source. + +For operating systems where no binary is provided, or if you want the latest development version, you will have to build it from source. The code should be compilable on any system with ISO C++17. It's tested on Ubuntu, macOS, and Windows. Less frequently, someone will build on FreeBSD, OpenBSD, Solaris, etc. Clang/LLVM, GNU C++, and MSVC are regularly exercised via automation. - + You can grab a release from the GPSBabel download page, but if you're going to be doing any development, you'll find that working from the GPSBabel Github repo is easier. Checkouts via Git, HTTPS, SSH, and Subversion are supported. -There are external requirements for bulding. - - - -Qt - - + There are external requirements for bulding. + + + + Qt + + + Qt version 5.12 or newer is required for all builds. MacOS and Windows users can download binaries from Qt Downloads Fedora or CentOS users may need to 'dnf install qt5-qtbase-devel'. When in doubt, 'dnf search qt' or 'dnf search qt5' may help you find the correct package name. Ubuntu users may need to 'apt-get install qt5-default'. Package names @@ -40,27 +41,25 @@ and versions in Linux frequently change, so you may need to ask your Linux vendo for help or look in tools/Docker* for inspiration for our automated builds that use Docker. - - - - - - libusb 1.0 - - - + + + + + libusb 1.0 + + + is needed to communicate with use with older USB Garmins. For macOS, we use an included copy. Fedora users may need to 'yum install libusb-devel'. Ubuntu users may need to 'apt install libusb-dev' or look in tools/Docker* for inspiration from our automated Docker builds. - - - - - -Brief history of internals - + + + + + Brief history of internals + Parts of GPSBabel have been public since 2002, with some of the original design and original code came from 2001. It was originally in C89, not C++ and while we strongly encourage modern C++ code where we can use it, we've @@ -72,74 +71,56 @@ from our automated Docker builds. not enforced style rules as strongly across modules as we could have. Fixing both of these is a goal for us in 2020. - - - - Building with Qt Creator - - Qt provides a lovely IDE (Integrated Development Evironment) with an - editor and debugger. Its use is strongly encouraged for those new to C++. - Once you have Qt correctly installed, just opening either the - GPSBabel.pro or gui/app.pro files from - the OS file launcher (e.g. a double click in macOS while seeing it in Finder) - or from a File->Open in an already-running instance of Qt Creator is the fastest and easiest way for most - people to get to development because it handles things like build dependencies - changing and class and method compilation. + + + Building with Qt Creator + +Qt provides a lovely IDE (Integrated Development Evironment) with an +editor and debugger. Its use is strongly encouraged for those new to C++. +Once you have Qt correctly installed, just opening the +CMakeLists.txt from +the File->Open menu in an already-running instance of Qt Creator is the fastest and easiest way for most +people to get to development because it handles things like build dependencies +changing and class and method compilation. - A path of low resistance for some users is to use the Qt build files (*.pro) - and compiler chain, but use the command line. If you type qmake in our working - directory, it will build a "native" Build file (Makefile, XCode, Visual Studio) - which you can use for development. + +A path of low resistance for some users is to use the CMakeLists.txt file +from the command line. If you type cmake . in our working +directory it will create a buildsystem with the default generator (Unix Makefiles or Visual Studio) which you can use for development. - - - Building with configure - -The GNU Build System (configure) is no longer supported and has -been removed. For command line builds please use qmake. - - - - Building with cmake - -The use of cmake is experimental. The implementation is not complete. It is -untested by continuous integration. It is not recommended for production use. - - - - Building with qmake - -Those familiar with the command line may be more comfortable -using qmake from the command line. In most cases, the code is as simple to build as running: - + + + Building from the command line - qmake && make +Those familiar with the command line may be more comfortable using cmake from the command line. +It is important to set the CMAKE_BUILD_TYPE when generating a build system with single configuration generators such as Unix Makefiles and Ninja. +With multi-configuration generators such as Visual Studio and Xcode the build type is selected at build time instead of when generating the build system. - -Two build methods are supported with MSVC tools. - +To create a buildsystem using Ninja: +cmake -G Ninja -DCMAKE_BUILD_TYPE=Release . + + To create a visual studio project that can be built with msbuild: -qmake -tp vc +cmake -G "Visual Studio 17 2022" . -To create a Makefile that can be built with nmake: -qmake +To create a Xcode project: +cmake -G Xcode . - - There are additional flags that can be passed to qmake to + + +There are additional variables that can be defined cmake on the cmake command line to customize your build of GPSBabel. - + - WITH_LIBUSB=no|pkgconfig|system*|included*|custom + GPSBABEL_WITH_LIBUSB=no|pkgconfig|system*|included*|custom - -note that libusb is NOT used on windows. - + note that libusb is NOT used on windows. no @@ -156,8 +137,10 @@ note that libusb is NOT used on windows. system - build with libusb-1.0 found on system library path and under -libusb-1.0 on system include path (default, linux, openbsd). + +build with libusb-1.0 found on system library path and under +libusb-1.0 on system include path (default, linux, openbsd). + @@ -169,15 +152,17 @@ libusb-1.0 on system include path (default, linux, openbsd). custom - build with user supplied libusb-1.0. LIBS and INCLUDEPATH may need to -be set, e.g. LIBS+=... INCLUDEPATH+=... + +build with user supplied libusb-1.0. LIBS and INCLUDEPATH may need to +be set with GPSBABEL_EXTRA_LINK_LIBRARIES and GPSBABEL_EXTRA_INCLUDE_DIRECTORIES. + - WITH_SHAPELIB=no|pkgconfig|included*|custom + GPSBABEL_WITH_SHAPELIB=no|pkgconfig|included*|custom @@ -201,15 +186,17 @@ be set, e.g. LIBS+=... INCLUDEPATH+=... custom - build with user supplied shapelib. LIBS and INCLUDEPATH may need to -be set, e.g. LIBS+=... INCLUDEPATH+=... + +build with user supplied shapelib. LIBS and INCLUDEPATH may need to +be set with GPSBABEL_EXTRA_LINK_LIBRARIES and +GPSBABEL_EXTRA_INCLUDE_DIRECTORIES. - WITH_ZLIB=no|pkgconfig|included*|custom + GPSBABEL_WITH_ZLIB=no|pkgconfig|included*|custom @@ -233,25 +220,76 @@ be set, e.g. LIBS+=... INCLUDEPATH+=... custom - build with user supplied zlib. LIBS and INCLUDEPATH may need to be -set, e.g. LIBS+=... INCLUDEPATH+=... + +build with user supplied zlib. LIBS and INCLUDEPATH may need to +be set with GPSBABEL_EXTRA_LINK_LIBRARIES and +GPSBABEL_EXTRA_INCLUDE_DIRECTORIES. - CONFIG+=disable-mappreview + GPSBABEL_MAPPREVIEW -This options disables the map preview feature. With the feature disabled +This options enables the map preview feature. With the feature disabled QtWebEngine and QtWebEngineWdigets are not used. Note that QtWebKit and QtWebKitWidgets are not longer supported. - + + + + + GPSBABEL_EMBED_MAP + + +Embed gmapbase.html for map preview. When using this option gmapbase.html +will be compiled into the executable and does not need to be distributed. + - DOCVERSION=... + GPSBABEL_EMBED_TRANSLATIONS + + +Embed translations. When using this option the gpsbabel provided +translations will be compiled into the executable and do not need to be +distributed. The Qt provided translations still need to be distributed. + + + + + GPSBABEL_ENABLE_PCH + + Enable precompiled headers when building the target gpsbabel. + + + + GPSBABEL_EXTRA_COMPILE_OPTIONS + + Extra compile options when building the target gpsbabel. + + + + GPSBABEL_EXTRA_INCLUDE_DIRECTORIES + + Extra directories to include when building the target gpsbabel. + + + + GPSBABEL_LINK_LIBRARIES + + Extra libraries to link when building the target gpsbabel. + + + + GPSBABEL_LINK_OPTIONS + + Extra link options when building the target gpsbabel. + + + + DOCVERSION string appended to documentation location for www.gpsbabel.org. The default @@ -262,7 +300,7 @@ www.gpsbabel.org. - WEB=DIR + WEB Path where the documentation will be stored for www.gpsbabel.org. This is @@ -273,7 +311,7 @@ maintaining www.gpsbabel.org. The default location is "../babelweb" -Additional makefile targets are available for special purposes. +Additional targets are available for special purposes. @@ -313,19 +351,17 @@ Additional makefile targets are available for special purposes. - gui + package_app - Build the graphical user interface. - - - - unix-gui - - Build the graphical user interface and collect the components for -distribution. On Linux the gpsbabel generated components will be under + +Collect the components for distribution. +On Linux the gpsbabel generated components will be under gui/GPSBabelFE, any dynamically linked required libraries are not included. On macOS an app bundle will be created at gui/GPSBabelFE.app and an apple disk -image will be created at gui/GPSBabelFE.dmg. +image will be created at gui/GPSBabelFE.dmg. +On windows an image will be created in the directory gui/package, and an +installer will be created gui/Setup-x.y.z-Setup.exe. + @@ -339,7 +375,7 @@ gmapbase.html. When compiled in these files do not need to be distributed. These are used by the GUI. Additional translation files from Qt will also be used if they are found. They may be in a package such as qttranslations5-l10n or qt5-qttranslations. - + - + diff --git a/zlib.pri b/zlib.pri deleted file mode 100644 index 2ab1a42f5..000000000 --- a/zlib.pri +++ /dev/null @@ -1,49 +0,0 @@ -!defined(WITH_ZLIB, var):WITH_ZLIB = included -equals(WITH_ZLIB, no) { - message("zlib disabled") - DEFINES += ZLIB_INHIBITED -} else { - equals(WITH_ZLIB, pkgconfig) { - message("Using zlib found by pkg-config") - PKGCONFIG += $$shell_quote(zlib > 1.2.8) - DEFINES += HAVE_LIBZ - } else:equals(WITH_ZLIB, included) { - # TODO: It would be better to create an archive and link to it - # to separate library build requirements from gpsbabel requirements. - SOURCES += \ - zlib/adler32.c \ - zlib/compress.c \ - zlib/crc32.c \ - zlib/deflate.c \ - zlib/inffast.c \ - zlib/inflate.c \ - zlib/infback.c \ - zlib/inftrees.c \ - zlib/trees.c \ - zlib/uncompr.c \ - zlib/gzlib.c \ - zlib/gzclose.c \ - zlib/gzread.c \ - zlib/gzwrite.c \ - zlib/zutil.c - INCLUDEPATH += zlib - HEADERS += \ - zlib/crc32.h \ - zlib/deflate.h \ - zlib/gzguts.h \ - zlib/inffast.h \ - zlib/inffixed.h \ - zlib/inflate.h \ - zlib/inftrees.h \ - zlib/trees.h \ - zlib/zconf.h \ - zlib/zlib.h \ - zlib/zutil.h - } else:equals(WITH_ZLIB, custom) { - message("zlib is enabled but but must be manually configured") - message(" e.g. qmake WITH_ZLIB=custom LIBS+=... INCLUDEPATH+=...") - DEFINES += HAVE_LIBZ - } else { - error("WITH_ZLIB=no|pkgconfig|included*|custom"); - } -} -- 2.30.2